feat(converters): re-enable variable scripting translations#8388
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (11)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (10)
WalkthroughPostman and Bruno variable translation tables now cover additional global and collection helper calls in both directions. Matching tests were re-enabled and expanded for direct assertions and transpiler scenarios. ChangesPostman↔Bruno variable translations
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Caution Failed to replace (edit) comment. This is likely due to insufficient permissions or the comment being deleted. Error details |
8bf8ff6 to
62ee62e
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@packages/bruno-converters/tests/postman/postman-translations/transpiler-tests/variables.test.js`:
- Around line 109-136: Add a regression test for the newly restored
pm.globals.toObject mapping in the variables translation suite. In
variables.test.js, extend the existing translateCode coverage alongside
pm.globals.unset, pm.globals.clear, and pm.collectionVariables.toObject to
assert that pm.globals.toObject() translates to bru.getAllGlobalEnvVars(). This
should exercise the postman-to-bruno-translator.js behavior so the restored
global toObject mapping stays covered.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 0530a85f-18fb-47e9-a77e-636a8654d43d
📒 Files selected for processing (11)
packages/bruno-converters/src/postman/postman-translations.jspackages/bruno-converters/src/utils/bruno-to-postman-translator.jspackages/bruno-converters/src/utils/postman-to-bruno-translator.jspackages/bruno-converters/tests/bruno/bruno-to-postman-translations/variables.test.jspackages/bruno-converters/tests/postman/postman-translations/postman-comments.spec.jspackages/bruno-converters/tests/postman/postman-translations/postman-variables.spec.jspackages/bruno-converters/tests/postman/postman-translations/transpiler-tests/combined.test.jspackages/bruno-converters/tests/postman/postman-translations/transpiler-tests/multiline-syntax.test.jspackages/bruno-converters/tests/postman/postman-translations/transpiler-tests/response.test.jspackages/bruno-converters/tests/postman/postman-translations/transpiler-tests/testing-framework.test.jspackages/bruno-converters/tests/postman/postman-translations/transpiler-tests/variables.test.js
…ble methods - Reintroduced translations for `setCollectionVar`, `deleteCollectionVar`, `deleteAllCollectionVars`, and their global counterparts in the Postman to Bruno and Bruno to Postman translators. - Updated tests to validate the translations for these methods, ensuring accurate functionality and consistency across variable management. - Removed outdated comments regarding UI updates, reflecting the current state of the implementation.
…als.toObject - Introduced new test cases to validate the translation of `bru.getAllGlobalEnvVars` to `pm.globals.toObject` and vice versa. - Enhanced the test suite for both Bruno to Postman and Postman to Bruno translations, ensuring comprehensive coverage for variable management methods.
62ee62e to
aeeea2a
Compare
Description
Re-enables Postman ↔ Bruno script translations that were previously commented out because the underlying runtime APIs would not propagate variable mutations to the UI tables. With variable persistence landing in #8315, these APIs now update both the request lifecycle and the UI, so the translations can be turned back on.
JIRA: BRU-3096
JIRA: BRU-3082
Important
Depends on #8315 — that PR must be merged first, otherwise the re-enabled translations will silently fail to update the UI.
Re-enabled translations
pm.globals.unsetbru.deleteGlobalEnvVarpm.globals.clearbru.deleteAllGlobalEnvVarspm.collectionVariables.setbru.setCollectionVarpm.collectionVariables.unsetbru.deleteCollectionVarpm.collectionVariables.clearbru.deleteAllCollectionVarspm.collectionVariables.toObjectbru.getAllCollectionVarsApplied in both directions and to both transformer paths:
packages/bruno-converters/src/utils/postman-to-bruno-translator.js(AST/jscodeshift)packages/bruno-converters/src/postman/postman-translations.js(regex fallback)packages/bruno-converters/src/utils/bruno-to-postman-translator.js(AST/jscodeshift)Tests
it.skip/test.skipblocks across 8 spec files covering the collection-variable APIs.pm.globals.unset,pm.globals.clear,pm.collectionVariables.clear,pm.collectionVariables.toObject, and theirbru.*reverse mappings).npm run test --workspace=packages/bruno-converters→ 71/71 suites pass, 1104 tests pass.Contribution Checklist:
Note: Keeping the PR small and focused helps make it easier to review and merge. If you have multiple changes you want to make, please consider submitting them as separate pull requests.
Publishing to New Package Managers
Please see here for more information.
Summary by CodeRabbit
New Features
set,unset,clear, and converting to object form.Tests
pm.collectionVariables.*andpm.globals.*.